#ifndef WARSQL_H
#define WARSQL_H

#include "tracksql.h"

#define WAR_GAMEID_SIZE		16
typedef char WarGameID[WAR_GAMEID_SIZE];

class WarSavedGame;

//
// All money values are in cents (100 == $1, 25 == $.25, 1 == $.01)
//
// IMPORTANT:  Access to this class is NOT thread-safe.  That's handled at
//			   the next level up (with calls to lock()/unlock()).
//

class WarSQL : public TrackSQL
{
	public:
		WarSQL(const String& DBDSN, const String& DBLogin, const String& DBPassword);

		int32 createGame(int32 casinoId,
			PID, bool8 forMoney, SESSIONID, int32 compFactor,
			WarGameID, int32 bet,
			int32* balance, int32* comp);

		int32 deal(PID, WarGameID, int32 numDealer, uint8 dealer,
			int32 numPlayer, uint8 player, bool8 raised);

		int32 gameDone(int32 casinoId, PID, bool8 forMoney, WarGameID,
			bool8 raised, bool8 noWar,
			int32 payAnte, int32 payRaise, int32 outcome,
			int32 balanceAdjust, int32* balance, int32* comp);

		int32 hasSavedGame(PID, bool8 forMoney,
			WarGameID, WarSavedGame*, bool8* exists);
		int32 removeSavedGame(PID, bool8 forMoney);
		int32 saveGame(PID, bool8 forMoney, WarGameID, WarSavedGame*);
};

#endif
